<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\TList
 *
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Task[] $tasks
 * @property-read int|null $tasks_count
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Board newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Board newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Board query()
 * @mixin \Eloquent
 * @property int $id
 * @property string $title
 * @property int $user_id
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Board whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Board whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Board whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Board whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Board whereUserId($value)
 */
class Board extends Model
{
    protected $fillable = [
        'title',
        'user_id'
    ];

    public function tasks()
    {
        return $this->hasMany(Task::class, 'board_id', 'id');
    }
}